package com.zz.cinema.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zz.cinema.dao.ITS_CustomerDao;
import com.zz.cinema.domain.TS_Customer;
import com.zz.cinema.service.ITS_CustomerService;
import com.zz.cinema.util.PageList;

@Service("customerService")
@Transactional
public class TS_CustomerServiceImpl implements ITS_CustomerService {

	@Resource
	private ITS_CustomerDao customerDao;

	@Override
	public boolean addCustomer(TS_Customer customer) {
		return customerDao.saveCustomer(customer);
	}

	@Override
	public boolean deleteCustomer(int id) {
		return customerDao.deleteCustomer(id);
	}

	@Override
	public TS_Customer updateCustomer(TS_Customer customer) {
		return customerDao.updateCustomer(customer);
	}

	@Override
	public TS_Customer queryCustomer(int id) {
		return customerDao.getCustomer(id);
	}

	@Override
	public PageList<TS_Customer> getPage(int page) {

		System.out.println(customerDao.getPage(2));
		return customerDao.getPage(page);
	}

}
